package com.zty.Demo;
import java.util.Scanner;
public class TransTOInt {
	public static void main(String[] args)
	{
		int n= transToInt("123564");
		System.out.println(n);
	}
	public static int transToInt(String str1) {
		int sum=0;
		int[]c=new int[str1.length()];
		for(int i=0;i<str1.length();i++)
		{
			System.out.println(str1.charAt(i));
			c[i]=str1.charAt(i)-'0';
		}
		int z=1;
		for(int j=c.length-1;j>=0;j--)
		{
			sum +=c[j]*z;
			z=z*10;
		}
		return sum;
	}
}
